package org.seckill.dto;

/**
 * json结果封装
 * Created by yuqin on 2016/6/13.
 */
public class SeckillResult<T> {
    /**
     * 状态
     */
    private boolean success;

    /**
     * 数据
     */
    private T data;

    private String error;

    /**
     * 成功
     * @param success 状态
     * @param data 数据
     */
    public SeckillResult(boolean success, T data) {
        this.success = success;
        this.data = data;
    }

    /**
     * 失败
     * @param success 状态
     * @param error 错误信息
     */
    public SeckillResult(boolean success, String error) {
        this.success = success;
        this.error = error;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}


